﻿@using Webdiyer.WebControls.Mvc

@model PagedList<WebShop.Contracts.LogItem>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<table>
    <tr>
        <th>
            User
        </th>
        <th>
            Time
        </th>
        <th>
            EventType
        </th>
        <th>
            Description
        </th>
        <th>
            Action
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.User.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Time)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EventType.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.ActionLink("Details", "Details", new { id = item.LogItemID })
        </td>
    </tr>
}

</table>

<p>
    @Html.Pager(Model, new PagerOptions() { PageIndexParameterName = "pageIndex", ShowDisabledPagerItems = false, AlwaysShowFirstLastPageNumber = true })
</p>